#pragma once

using namespace Microsoft::Office::Interop;

namespace KinControl{


public ref class KinExcel
{
public:
	KinExcel(void);
	~KinExcel();
	Excel::Application^ ExApp;

	int OpenExcel(System::String^ sFileName, Excel::Workbook^ %ResultBook);
	int OpenExcel(System::String^ sFileName, System::Object^ ReadOnly, System::Object^ Password, Excel::Workbook^ %ResultBook);
	int CloseExcel(int IsSave, Excel::Workbook^ %wBook);

	int GetExcelValue(Excel::Workbook^ ExBook,int x, int y, System::String^ %sResult);
	int SetExcelValue(Excel::Workbook^ ExBook,int x, int y, System::String^ sDestString);
	int DeleteExcelLine(Excel::Workbook^ ExBook,int y);

	int GetExcelValue(Excel::Worksheet^ ExWorkSheet,int x, int y, System::String^ %sResult);
	int SetExcelValue(Excel::Worksheet^ ExWorkSheet,int x, int y, System::String^ sDestString);
	int DeleteExcelLine(Excel::Worksheet^ ExWorkSheet,int y);
	
	int GetFirstEmpyt(System::Object^ rgSource, int &nResult);
};



}